package com.decent.web.system.service.impl;

import com.decent.common.bo.MessageBean;
import com.decent.web.system.vo.SystemClassifyVO;
import com.decent.web.system.dao.SystemClassifyDao;
import com.decent.web.system.service.SystemClassifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: decent Gjh
 * @date: 2022/10/25/18:35
 * @description:
 */
@Service
@Slf4j
public class SystemClassifyServiceImpl implements SystemClassifyService {
    private final SystemClassifyDao classifyDao;

    public SystemClassifyServiceImpl(SystemClassifyDao classifyDao) {
        this.classifyDao = classifyDao;
    }


    /**
     * 查找分类
     * @return 是否成功
     */
    @Override
    public MessageBean selectClassify() {
        List<SystemClassifyVO> classifies = classifyDao.selectClassify();
        if (classifies==null||classifies.isEmpty()) {
            return MessageBean.success("暂无数据");
        }
        return MessageBean.success(classifies);
    }

}
